package model.Actions;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import view.ViewFunctions;
import DB.Connection.DBConnectionManager;

import commons.Entities.SearchResults;

public class getSearchResultsAction implements Runnable {

	private static final Log logger = LogFactory.getLog(getSearchResultsAction.class);

	private String characterName;
	private String gender;
	private String species;

	public getSearchResultsAction(String characterName, String gender, String species) {
		this.characterName = characterName;
		this.gender = gender;
		this.species = species;
	}

	@Override
	public void run() {
		logger.info("getSearchResultsAction starting...");

		SearchResults searchResults = DBConnectionManager.get().getSearchResults(characterName, gender, species);
		ViewFunctions.get().updateGUISearchResults(searchResults);

		logger.info("getSearchResultsAction ended.");
	}
}
